package com.carsite.model;


import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 *  分支机构表
 * @struts.form include-all="false" extends="BaseForm"
 * @hibernate.class table="WT_branch"
 */
public class Branch extends BaseObject implements Serializable {
	
	private Long branchId;         //Id
   
	private String branchName;           //名称
	
    protected String address ;           //地址
	
	private String telNo;              //电话
	
	private Branch   parent;          //父机构
	
	private Set    depts = new HashSet();   //部门
	
    private Set    children = new HashSet();
	
    /**
     * @struts.form-field form-name="BranchForm"
     * @hibernate.id column="branchId" generator-class="increment" unsaved-value="null"
     */
	
	public Long getBranchId() {
		return branchId;
	}
    
	 /**
     * @struts.form-field form-name="BranchForm"
     * @struts.validator type="required"
     * @hibernate.property column="branchName" not-null="true" length="50" unique="true"
     */
	public String getBranchName() {
		return branchName;
	}
    
	 /**
     * @struts.form-field form-name="BranchForm"
     * @hibernate.property column="address" length="200"
     */
	public String getAddress() {
		return address;
	}


	 /**
     * @struts.form-field form-name="BranchForm"
     * @hibernate.property column="telNo" length="50"
     */
	public String getTelNo() {
		return telNo;
	}
   
	/**
	 * 
	 * @hibernate.many-to-one 
	 *   name="parent"
	 *   column="parentId"
	 *   not-null="false"
	 *   class="com.carsite.model.Branch"
	 */
	public Branch getParent() {
		return parent;
	}
	/**
	 * @hibernate.set	name="chindren" cascade="delete-orphan" inverse="true" lazy="false"
	 * @hibernate.one-to-many	 class="com.carsite.model.Branch"
	 * @hibernate.collection-key column="parentId"
	 * 
	 */
	public Set getChildren() {
		return children;
	}
  
	
	/**
	 * @hibernate.set	name="chindren" cascade="delete-orphan" inverse="true" lazy="false"
	 * @hibernate.one-to-many	 class="com.carsite.model.Department"
	 * @hibernate.collection-key column="branchId"
	 * 
	 */
	public Set getDepts() {
		return depts;
	}

	public void setDepts(Set depts) {
		this.depts = depts;
	}

	public void setChildren(Set children) {
		this.children = children;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setBranchId(Long branchId) {
		this.branchId = branchId;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	public void setParent(Branch parent) {
		this.parent = parent;
	}

	public void setTelNo(String telNo) {
		this.telNo = telNo;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	
	 

	

}
